home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LT_DisposeMenu.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  2KB  |  74 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. /*****************************************************************************/
  15.  
  16. #include <stddef.h>
  17.  
  18. /*****************************************************************************/
  19.  
  20. #include "Assert.h"
  21.  
  22. /*****************************************************************************/
  23.  
  24. #ifdef DO_MENUS    /* Support code */
  25.  
  26. /****** gtlayout.library/LT_DisposeMenu ******************************************
  27. *
  28. *   NAME
  29. *    LT_DisposeMenu -- Release storage space allocated by
  30. *                      LT_NewMenuTemplate or LT_NewMenuTagList (V11)
  31. *
  32. *   SYNOPSIS
  33. *    LT_DisposeMenu(Menu)
  34. *                    A0
  35. *
  36. *    VOID LT_DisposeMenu(struct Menu *);
  37. *
  38. *   FUNCTION
  39. *    Menus and MenuItems allocated by LT_NewMenuTemplate or
  40. *    LT_NewMenuTagList are deallocated.
  41. *
  42. *   INPUTS
  43. *    Menu - Pointer to Menu structure as returned by
  44. *        LT_NewMenuTemplate or LT_NewMenuTagList. Passing
  45. *        NULL is harmless.
  46. *
  47. *   RESULT
  48. *    none
  49. *
  50. *   SEE ALSO
  51. *    gtlayout.library/LT_NewMenuTagList
  52. *    gtlayout.library/LT_NewMenuTemplate
  53. *
  54. ******************************************************************************
  55. *
  56. */
  57.  
  58. VOID LIBENT
  59. LT_DisposeMenu(REG(a0) struct Menu *Menu)
  60. {
  61.     if(Menu)
  62.     {
  63.         struct RootMenu *Root = (struct RootMenu *)((ULONG)Menu - offsetof(struct RootMenu,Menu));
  64.  
  65.         FreeScreenDrawInfo(Root->Screen,Root->DrawInfo);
  66.  
  67.         CloseFont(Root->Font);
  68.  
  69.         AsmDeletePool(Root->Pool,SysBase);
  70.     }
  71. }
  72.  
  73. #endif    /* DO_MENUS */
  74.